//SPDX-FileCopyrightText: Copyright 2022-2024 深圳市同心圆网络有限公司
//SPDX-License-Identifier: GPL-3.0-only

package idea_dao

import "go.mongodb.org/mongo-driver/mongo"

var IdeaGroupDao *_IdeaGroupDao
var IdeaDao *_IdeaDao
var AppraiseDao *_AppraiseDao
var IdeaStoreCateDao *_IdeaStoreCateDao
var IdeaStoreDao *_IdeaStoreDao
var StoreIdeaDao *_StoreIdeaDao
var IdeaRecycleDao *_IdeaRecycleDao

func InitDao(mgoDb *mongo.Database) (err error) {
	IdeaGroupDao, err = newIdeaGroupDao(mgoDb)
	if err != nil {
		return
	}
	IdeaDao, err = newIdeaDao(mgoDb)
	if err != nil {
		return
	}
	AppraiseDao, err = newAppraiseDao(mgoDb)
	if err != nil {
		return
	}
	IdeaStoreCateDao, err = newIdeaStoreCateDao(mgoDb)
	if err != nil {
		return
	}
	IdeaStoreDao, err = newIdeaStoreDao(mgoDb)
	if err != nil {
		return
	}
	StoreIdeaDao, err = newStoreIdeaDao(mgoDb)
	if err != nil {
		return
	}
	IdeaRecycleDao, err = newIdeaRecycleDao(mgoDb)
	if err != nil {
		return
	}
	return
}
